package com.example.site.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.util.SaResult;
import com.example.site.service.ConfigService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/api/config")
public class ConfigController {

    @Resource
    ConfigService configService;

    @GetMapping("/get")
    public SaResult get() {
        return configService.get();
    }

    @SaCheckLogin
    @PostMapping("/set")
    public SaResult set(@RequestBody Map<String, String> data) {
        return configService.set(data);
    }
}
